//
//  __base.swift
//  eemall
//
//  Created by zhuxietong on 2019/1/14.
//  Copyright © 2019 tianrun. All rights reserved.
//

import Foundation
import UIKit
//主要针对基础购买、团购 或后续将要开发的秒杀拍卖页面公用但接口不同的区分处理

extension Bundle{
//    func ps()  {
//        var bundle = Bundle(for: CateSelector.self)
//        if let resourcePath = bundle.path(forResource: "XLPagerTabStrip", ofType: "bundle") {
//            if let resourcesBundle = Bundle(path: resourcePath) {                    
//                bundle = resourcesBundle
//                bundle
//            }
//        }
//
//    }
}

public enum SaleScheme:String{
    case normal = "normal"
    case group = "group"
    
    public var orderDetailURL:_SURL{
        switch self {
        case .group:
            return _SURL.团购订单详情
        default:
            return _SURL.订单详情
        }
    }
    
    public var confirmReceiveURL:_SURL{
        switch self {
        case .group:
            return _SURL.团购确认收货
        default:
            return _SURL.确认收货
        }
    }
    

    
    public var getOrderCommentURL:_SURL{
        switch self {
        case .group:
            return _SURL.获取某个团购订单评价
        default:
            return _SURL.获取某个订单评价
        }
    }
    
    public var submitCommentURL:_SURL{
        switch self {
        case .group:
            return _SURL.评论团购商品订单
        default:
            return _SURL.评论商品订单
        }
    }
    
    
    public var goodsCommentsListURL:_SURL{
        switch self {
        case .group:
            return _SURL.团购商品评论列表
        default:
            return _SURL.评论列表
        }
    }
    
    public func openDetail(info:NSMutableDictionary,at:UIViewController?) {
        switch self {
        case .normal:
            Goods.seeDetail(obj: info, at: at)
        case .group:
            GroupActive.seeDetail(obj: info, at: at)
        }
    }
}
